package cn.qqcn.common.controller;

import com.wf.captcha.utils.CaptchaUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
public class CommonController {

    @GetMapping({"/login"})
    public String hello() {
        return "login";
    }

    @GetMapping({"/index"})
    public String index() {
        return "index";
    }

    @GetMapping({"/welcome"})
    public String welcome() {
        return "welcome";
    }

    @RequestMapping({"/captcha"})
    public void captcha(HttpServletRequest request, HttpServletResponse response) throws Exception {
        CaptchaUtil.out(request, response);
        System.out.println("收到验证码请求");
    }
}
